<?php

require_once("aDAO.class.php");
require_once("../control/Conexao.class.php");
require_once("../models/Vendedor.class.php");

class VendedorDAO extends aDAO {

    private $insert_sql = "";
    private $update_sql = "";
    private $delete_sql = "";

    public function __construct() {
        parent::__construct();
    }

    public function insert($objeto) {
        $this->conexao->beginTransaction();
        try {
            $temp = new Vendedor();
            $temp = $objeto;

            $stmt = $this->conexao->prepare($insert_sql);
            $stmt->bindParam(1, $temp->getIdVendedor());
            $stmt->bindParam(2, $temp->getNome());

            $stmt->execute();
            $this->conexao->commit();

            return $this->conexao->lastInsertId();
        } catch (Exception $e) {
            $this->conexao_mysql->rollBack();
        }

        return "erro";
    }

    public function update($objeto) {

        $this->conexao->prepare($this->update_sql);
    }

    public function delete($objeto) {

        $this->conexao->prepare($this->delete_sql);
    }

    public function select($objeto) {
        $listaObjetos;

        return $listaObjetos;
    }

}

?>